package common;

public class DNInfo {
    private String ip;
    private int port;
    private int tPort;
    private Boolean alive; // 表示datanode状态
    public DNInfo(String ip,int port){
        this.ip = ip;
        this.port = port;
        alive = true;
    }

    public int gettPort() {
        return tPort;
    }

    public void settPort(int tPort) {
        this.tPort = tPort;
    }

    public DNInfo(String ip, int port, Boolean alive) {
        this.ip = ip;
        this.port = port;
        this.alive = alive;
        this.tPort = -1;
    }

    public DNInfo(String ip,int port,int tPort){
        this.ip = ip;
        this.port = port;
        this.tPort = tPort;
        alive = true;
    }


    public String getIp() {
        return ip;
    }

    public int getPort() {
        return port;
    }

    public Boolean getAlive() {
        return alive;
    }

    public void setAlive(Boolean alive) {
        this.alive = alive;
    }

    @Override
    public String toString() {
        return ip + port +
                ", alive=" + alive +
                '}';
    }
}
